package com.lx.rpc.framework.protocol.http;

import com.lx.rpc.framework.base.Invocation;
import com.lx.rpc.framework.protocol.Protocol;
import com.lx.rpc.framework.protocol.URL;


/**
 * http协议
 * @author wcy
 */
public class HttpProtocol implements Protocol {


    @Override
    public void start(URL url) {
        new HttpServer().start(url.getIp(),url.getPort());
    }

    @Override
    public String send(URL url, Invocation invocation) {

        HttpClient httpClient = new HttpClient();
        return httpClient.sendRequest(url.getIp(),url.getPort(),invocation);

    }
}
